
export default {
	name: 'NameCodeUnitTemplate',
	props: {
		value: {
			type: Object,
			default() {
				return {
					// pointCode: '参数编码',
					// pointName: '参数名称',
					// pointUnit: '参数单位',
				}
			}
		},
		transform: {
			type: Object,
			default() {
				return {
					x: 0,
					y: 0,
					rotation: 0,
					width: 0,
					height: 0,
				}
			}
		},
		styleObj: {
			type: Object,
			default() {
				return {
				}
			}
		},
		ddr: {
			type: Object,
			default() {
				return {
				}
			}
		},
	},
	data() {
		return {
		};
	},
	methods: {
		customEmit(value, prop) {
			this.$emit('change', {
				value,
				prop,
			})
		},
	},
	render: function(h) {
		return (
			<el-form label-width="100px" size="mini">
				<p>组件信息</p>
			  <el-form-item label="名称">
			    <el-input vModel={this.value.pointName} onInput={(value) => this.customEmit(value, 'pointName')}></el-input>
			  </el-form-item>
			  <el-form-item label="编码">
			    <el-input vModel={this.value.pointCode} onInput={(value) => this.customEmit(value, 'pointCode')}></el-input>
			  </el-form-item>
			  <el-form-item label="单位">
			    <el-input vModel={this.value.pointUnit} onInput={(value) => this.customEmit(value, 'pointUnit')}></el-input>
			  </el-form-item>
				<p>样式信息</p>
				<el-form-item label="宽高">
				  <el-input-number value={this.transform.width} onChange={(value) => this.customEmit(value, 'width')}></el-input-number>
				  <el-input-number value={this.transform.height} onChange={(value) => this.customEmit(value, 'height')}></el-input-number>
				</el-form-item>
				<el-form-item label="坐标">
				  <el-input-number value={this.transform.x} onChange={(value) => this.customEmit(value, 'x')}></el-input-number>
				  <el-input-number value={this.transform.y} onChange={(value) => this.customEmit(value, 'y')}></el-input-number>
				</el-form-item>
				<el-form-item label="旋转角度">
				  <el-input-number value={this.transform.rotation} onChange={(value) => this.customEmit(value, 'rotation')}></el-input-number>
				</el-form-item>
			</el-form>
		)
	},
}